home *** CD-ROM | disk | FTP | other *** search
- #if !defined(__astdsbpar_h)
- #define __astdsbpar_h
-
- /* Projekt csbparse
- softbase
- Copyright ⌐ 1993-1998 by SoftBase
-
- SUBSYSTEM: csbparse.dll 3.7
- FILENAME: astdsbpar.h
-
- ABSTRACT
- ========
- Functions for creation and use of sbParser and sbCalculator objects by
- HANDLE (void*) with any C/C++ compiler.
- */
-
- //+++Remember to include the astsbpar.cpp into your project+++
-
- #if defined(__BORLANDC__)
- #else
- #endif
-
- #include <windows.h>
-
- //------ DLL functions ---------------------------------------------------------
-
- bool InitSTDsbParserDLL(char* iv = NULL);
- void InitMessageOut();
- int GetInitCount();
- bool IsRegSTDsbParser();
- bool DeinitSTDsbParserDLL();
-
- //------ sbParser functions ----------------------------------------------------
-
- char* GetParserVersionString(char *strbuffer);
- char* GetParserVersionNumber(char *strbuffer);
-
- //iux == reserved for internal use
- HANDLE CreateNewParser(char *FunctionIn, int VarCountIn,
- char *VarDescIn,
- bool iu1 = true, bool iu2 = true, bool iu3 = true, bool iu4 = true);
- HANDLE CreateNewParser(char *FunctionIn, int BaseIn = 10,
- bool iu1 = true, bool iu2 = true, bool iu3 = true, bool iu4 = true);
- HANDLE CreateNewParser(char *FunctionIn, int BaseIn,
- int VarCountIn, char *VarDescIn,
- bool iu1 = true, bool iu2 = true, bool iu3 = true, bool iu4 = true);
-
- bool DeleteParser(HANDLE hParser);
-
- bool SetVarCont(HANDLE hParser, const char *AVarDescIn,
- long double VarContIn);
-
- long double GetResult(HANDLE hParser);
- long double GetResult(HANDLE hParser, long double VarContIn);
- long double GetResultExt(HANDLE hParser, long double VarContIn[]);
-
- bool IsParserFunction(const char *FuncStrIn);
-
- //use these functions if your compiler doesn't support long double (80bit)
- bool dSetVarCont(HANDLE hParser, const char *AVarDescIn,
- double VarContIn);
-
- double dGetResult(HANDLE hParser);
- double dGetResult(HANDLE hParser, double VarContIn);
- double dGetResultExt(HANDLE hParser, double VarContIn[]);
- //+++
-
- const char* GetOriginFunc(HANDLE hParser, char *strbuffer);
- long GetOriginFuncLen(HANDLE hParser);
- int GetOriginVarCount(HANDLE hParser);
- bool GetIsOriginFunc(HANDLE hParser, char *FunctionIn);
-
- bool GetIsError(HANDLE hParser);
- int GetGlobalError(HANDLE hParser);
- char* GetUnknownFunction(HANDLE hParser, char *strbuffer);
-
- bool SetBaseTo(HANDLE hParser, int BaseIn);
- bool SetAngularUnitTo(HANDLE hParser, int AngularUnitIn);
- bool SetNewFunction(HANDLE hParser, char *FunctionIn);
-
- int GetBase(HANDLE hParser);
- int GetAngularUnit(HANDLE hParser);
-
- //------ useful functions -----------------------------------------------------
-
- bool ConvertToBase(char *strbuffer, const long double value,
- int b_point, int BaseIn);
- long double ConvertBaseTold(const char *strValue, int BaseIn,
- char **endptr = NULL);
- long double ConvertBaseTold(const char *strValue, int BaseIn,
- int* errPos);
-
- unsigned int SetFPError(bool Enable = false);
-
- char* ldtochar(char *strbuffer, const long double value,
- int point = 0, bool Validate = true);
- long double chartold(const char *strValue, char **endptr = NULL,
- bool Validate = true);
- long double chartold(const char *strValue, int* errPos,
- bool Validate = true);
-
- long double corrroundl(long double value);
- long double corrroundl(long double value,int point);
-
- char* turnintochar(char *strbuffer, const char *SubFuncIn, const char *searchIn,
- const char *turnIn, bool singleVar = false);
- char* GetLastValue(char* strbuffer, const char* SearchString,
- int CurrPos, int *StartPos, bool withOper = false);
-
- //use these functions if your compiler doesn't support long double (80bit)
- bool dConvertToBase(char *strbuffer, const double value,
- int b_point, int BaseIn);
- double ConvertBaseTod(const char *strValue, int BaseIn,
- char **endptr = NULL);
- double ConvertBaseTod(const char *strValue, int BaseIn,
- int* errPos);
-
- char* dtochar(char *strbuffer, const double value,
- int point = 0, bool Validate = true);
- double chartod(const char *strValue, char **endptr = NULL,
- bool Validate = true);
- double chartod(const char *strValue, int* errPos,
- bool Validate = true);
-
- double corrround(double value,int point);
- //+++
-
- //------ Debug and Information -------------------------------------------------
-
- bool GetDebugsbDLL();
- bool SetDebugsbDLL(bool debugIn);
-
- bool GetVarStruct(HANDLE hParser, HANDLE VarStructIn);
- bool GetOpStructPos(HANDLE hParser, int pos, char *buffFunction,
- int* val1, int* val2, int* valResult);
- bool GetInvValuesPos(HANDLE hParser, int pos, long double *val);
-
- //use these functions if your compiler doesn't support long double (80bit)
- bool dGetVarStruct(HANDLE hParser, HANDLE VarStructIn);
- bool dGetInvValuesPos(HANDLE hParser, int pos, double *val);
- //+++
-
- //------ sbCalculator functions ------------------------------------------------
-
- HANDLE CreateNewCalculator(char *InitStr, bool fastIn = true,
- int VarCountIn = 0, char* VarDescIn = "");
-
- bool DeleteCalculator(HANDLE hCalculator);
-
- int GetVarCount(HANDLE hCalculator);
- char *GetFunction(HANDLE hCalculator, char *strbuffer);
-
- //iux == reserved for internal use
- bool Make(HANDLE hCalculator, char *Input, bool iu1 = false);
-
- char *GetShowFunc(HANDLE hCalculator, char *strbuffer,int point = 0,
- long double VarContIn[] = 0, bool ext = false,
- char* secondShow = 0);
- long double GetLastResult(HANDLE hCalculator);
-
- //use these functions if your compiler doesn't support long double (80bit)
- char *dGetShowFunc(HANDLE hCalculator, char *strbuffer,int point = 0,
- double VarContIn[] = 0, bool ext = false,
- char* secondShow = 0);
- double dGetLastResult(HANDLE hCalculator);
- //+++
-
- char *GetInfo(HANDLE hCalculator, char *strbuffer);
-
- void SetFast(HANDLE hCalculator, bool fastIn = true);
- bool GetFast(HANDLE hCalculator);
-
- void SetFatalErr(HANDLE hCalculator, bool FatalErrIn=true);
- bool GetFatalErr(HANDLE hCalculator);
-
- bool SetAngularUnitInOutTo(HANDLE hCalculator, int AngularUnitIn);
- int GetAngularUnitInOut(HANDLE hCalculator);
- bool SetBaseInTo(HANDLE hCalculator, int BaseIn);
- int GetBaseIn(HANDLE hCalculator);
- bool SetBaseOutTo(HANDLE hCalculator, int BaseIn);
- int GetBaseOut(HANDLE hCalculator);
-
- #endif // __astdsbpar_h
-